from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

app_name = 'users'

# API路由
router = DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'profiles', views.ProfileViewSet)

# Web路由
urlpatterns = [
    # API路由
    path('api/', include(router.urls)),
    
    # Web界面路由
    path('', views.HomeView.as_view(), name='home'),
    path('dashboard/', views.DashboardView.as_view(), name='dashboard'),
    path('login/', views.web_login, name='login'),
    path('register/', views.web_register, name='register'),
    path('logout/', views.web_logout, name='logout'),
]